<template>
  <div id="app">
   <datav />
   <!-- 全局错误通知 -->
   <ErrorMessage ref="errorMessage" />
  </div>
</template>

<script>
import datav from './components/datav/index.vue'
import ErrorMessage from './plugins/ErrorMessage.vue'
export default {
  name: 'App',
  components: {
    datav,
    ErrorMessage
  },
  created() {
    // 挂载 $error 全局方法
    this.$error = (message, duration) => {
      this.$refs.errorMessage?.show({ message, duration })
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
